<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>JQuery动态事件处理</title>
		<link rel="stylesheet" type="text/css" href="css/txt.css" />
		<script src="js/jquery.js" type="text/javascript" charset="utf-8"></script>
	</head>

	<body>
		<div>
			<div id="email-1">邮件1, xxx .
				<a href="#" id="delete-1">删除</a>
			</div>
			<div id="email-2">邮件2, xxx .
				<a href="#" id="delete-2">删除</a>
			</div>
			<div id="email-3">邮件3, xxx .
				<a href="#" id="delete-3">删除</a>
			</div>
			<div id="email-4">邮件4, xxx .
				<a href="#" id="delete-4">删除</a>
			</div>
			<div id="email-5">邮件5, xxx .
				<a href="#" id="delete-5">删除</a>
			</div>
		</div>
	</body>

	<script type="text/javascript">
		$(function() {
			// 动态删除邮件
			$("[id*=delete]").on("click",function(){
				// 获取截取的id数组
				var parEle = $(this).parent();
				alert($(this).attr("id"));
				parEle.remove();
			});
		});
	</script>

</html>